package atm.zhaz;

import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;

public class TwoFieldForm extends SmallWindow implements ActionListener {
	JTextField login1;
	JTextField pass1;
	JFrame parent;

	public TwoFieldForm(String title, String first, String second) {
		setTitle(title);

		JLabel wel = new JLabel(title);
		Font a = new Font("Times New Roman", Font.BOLD, 24);
		wel.setFont(a);
		wel.setForeground(Color.BLACK);
		wel.setBounds(130, 30, 250, 30);
		add(wel);

		JLabel login = new JLabel(first);
		Font aa = new Font("Times New Roman", Font.BOLD, 20);
		login.setFont(aa);
		login.setForeground(Color.BLACK);
		login.setBounds(50, 70, 250, 20);
		add(login);

		login1 = new JTextField();
		login1.setBounds(160, 70, 130, 20);
		login1.setForeground(Color.black);
		add(login1);

		JLabel pass = new JLabel(second);
		pass.setFont(aa);
		pass.setForeground(Color.BLACK);
		pass.setBounds(50, 100, 250, 20);
		add(pass);

		pass1 = new JTextField();
		pass1.setBounds(160, 100, 130, 20);
		pass1.setForeground(Color.DARK_GRAY);
		add(pass1);

		JButton ok = new JButton("OKoy");
		ok.setBounds(215, 150, 70, 20);
		add(ok);
		ok.addActionListener(this);
	}

	public String getLogin1() {
		return login1.getText();
	}

	public String getPass1() {
		return pass1.getText();
	}


	@Override
	public JFrame getParent() {
		return parent;
	}

	public void setParent(JFrame parent) {
		this.parent = parent;
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		setVisible(false);
	}


}
